#############################################################################
##
#W  groupsearch.gd           DifSets Package                     Dylan Peifer
##
##  Functions set up the algorithm and pass work off to the refining and
##  equivalent list functions for each stage.
##

DeclareGlobalFunction( "ExportMultipliers" );

#############################################################################
##
#F  RefiningSeries( <G> )
##
##  <#GAPDoc Label="RefiningSeries">
##  <ManSection>
##  <Func Name="RefiningSeries" Arg="G"/>
##
##  <Description>
##  Returns a normal series for group <A>G</A>. Current implementation
##  produces a chief series through a nontrivial normal subgroup of smallest
##  possible size in <A>G</A>.
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(8, 3);;
##  gap> List(RefiningSeries(G), N -> Size(N));
##  [ 8, 4, 2, 1 ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
DeclareGlobalFunction( "RefiningSeries" );

#############################################################################
##
#F  PossibleDifferenceSetSizes( <G> )
##
##  <#GAPDoc Label="PossibleDifferenceSetSizes">
##  <ManSection>
##  <Func Name="PossibleDifferenceSetSizes" Arg="G"/>
##
##  <Description>
##  Returns a list of the possible sizes of difference sets in group
##  <A>G</A>. Only the smaller of any pair of complementary sizes is
##  returned, and the trivial size 1 is never included. Current
##  implementation simply returns all values of k such that lambda = 
##  k(k-1)/(v-1) is an integer, where v is the order of <A>G</A>, and the
##  resulting parameters v, k, lambda pass the Bruck-Ryser-Chowla test.
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(31, 1);;
##  gap> PossibleDifferenceSetSizes(G);
##  [ 6, 10, 15 ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
DeclareGlobalFunction( "PossibleDifferenceSetSizes" );

#############################################################################
##
#F  PossibleDifferenceSetPairSizes( <G> )
##
##  <#GAPDoc Label="PossibleDifferenceSetPairSizes">
##  <ManSection>
##  <Func Name="PossibleDifferenceSetPairSizes" Arg="G"/>
##
##  <Description>
##  Returns a list of the possible sizes (return as [k1, k2, e, lambda]) of difference set pairs in group
##  <A>G</A>. Only the smaller of any pair of complementary sizes is
##  returned, and the trivial size 1 is never included. Current
##  implementation simply returns all values of k1, k2, e, lambda such that k1*k2 = λ*(v-1) + e
##  where λ is an integer, v is the order of <A>G</A>, k1 k2 are the possible size of D1 D2, e is
##  the order of D1∩D2. 
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(31, 1);;
##  gap> PossibleDifferenceSetPairSizes(G);
##  [ [ 6, 5, 0, 1 ], [ 6, 6, 6, 1 ], [ 7, 5, 5, 1 ], [ 8, 4, 2, 1 ], [ 8, 8, 4, 2 ], [ 9, 7, 3, 2 ], [ 10, 3, 0, 1 ], [ 10, 6, 0, 2 ],
##  [ 10, 9, 0, 3 ], [ 10, 10, 10, 3 ], [ 11, 3, 3, 1 ], [ 11, 6, 6, 2 ], [ 11, 9, 9, 3 ], [ 11, 11, 1, 4 ], [ 12, 5, 0, 2 ],
##  [ 12, 8, 6, 3 ], [ 12, 10, 0, 4 ], [ 13, 5, 5, 2 ], [ 13, 7, 1, 3 ], [ 13, 10, 10, 4 ], [ 13, 12, 6, 5 ], [ 14, 9, 6, 4 ],
##  [ 14, 11, 4, 5 ], [ 14, 13, 2, 6 ], [ 15, 2, 0, 1 ], [ 15, 4, 0, 2 ], [ 15, 6, 0, 3 ], [ 15, 8, 0, 4 ], [ 15, 10, 0, 5 ],
##  [ 15, 12, 0, 6 ], [ 15, 14, 0, 7 ], [ 15, 15, 15, 7 ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
# FEATURE PossibleDifferenceSetPairSizes(G)
DeclareGlobalFunction( "PossibleDifferenceSetPairSizes" );

#############################################################################
##
#F  PossibleDivisibleDifferenceSetSizes( <G> )
##
##  <#GAPDoc Label="PossibleDivisibleDifferenceSetSizes">
##  <ManSection>
##  <Func Name="PossibleDivisibleDifferenceSetSizes" Arg="G"/>
##
##  <Description>
##  Returns a list of the possible sizes (return as [w, v, l, lambda1, lambda2]) of divisible difference sets in group
##  <A>G</A>. Only the smaller of any pair of complementary sizes is
##  returned, and the trivial size 1 is never included.
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(15, 1);;
##  gap> PossibleDivisibleDifferenceSetSizes(G);
##  [ [ 3, 5, 6, 5, 1 ], [ 3, 5, 7, 3, 3 ], [ 3, 5, 7, 8, 1 ], [ 5, 3, 5, 4, 1 ], [ 5, 3, 6, 3, 2 ], [ 5, 3, 6, 9, 1 ],
##  [ 5, 3, 7, 3, 3 ], [ 5, 3, 7, 9, 2 ], [ 5, 3, 7, 15, 1 ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
# FEATURE PossibleDivisibleDifferenceSetSizes(G)
DeclareGlobalFunction( "PossibleDivisibleDifferenceSetSizes" );

#############################################################################
##
#F  PossibleDivisibleDifferenceSetPairSizes( <G> )
##
##  <#GAPDoc Label="PossibleDivisibleDifferenceSetPairSizes">
##  <ManSection>
##  <Func Name="PossibleDivisibleDifferenceSetPairSizes" Arg="G"/>
##
##  <Description>
##  Returns a list of the possible sizes (return as [w, v, l1, l2, le, lambda1, lambda2]) 
##  of divisible difference set pairs in group <A>G</A>. Only the smaller of any pair of 
##  complementary sizes is returned, and the trivial size 1 is never included.
##
##  <Example><![CDATA[
##  gap> G:=SmallGroup(15,1);
##  <pc group of size 15 with 2 generators>
##  gap> PossibleDivisibleDifferenceSetPairSizes(G);
##  [ [ 3, 5, 4, 4, 2, 1, 1 ], [ 3, 5, 5, 3, 1, 1, 1 ], [ 3, 5, 5, 4, 2, 2, 1 ], [ 3, 5, 5, 5, 1, 1, 2 ], [ 3, 5, 5, 5, 3, 3, 1 ],
##  [ 3, 5, 6, 3, 0, 2, 1 ], [ 3, 5, 6, 4, 0, 1, 2 ], [ 3, 5, 6, 4, 2, 3, 1 ], [ 3, 5, 6, 5, 0, 5, 1 ], [ 3, 5, 6, 5, 2, 2, 2 ],
##  [ 3, 5, 6, 5, 4, 4, 1 ], [ 3, 5, 6, 6, 0, 4, 2 ], [ 3, 5, 6, 6, 2, 1, 3 ], [ 3, 5, 6, 6, 2, 6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, 2 ], [ 5, 3, 7, 7, 1, 18, 1 ],
##  [ 5, 3, 7, 7, 3, 5, 3 ], [ 5, 3, 7, 7, 3, 11, 2 ], [ 5, 3, 7, 7, 3, 17, 1 ], [ 5, 3, 7, 7, 5, 4, 3 ], [ 5, 3, 7, 7, 5, 10, 2 ],
##  [ 5, 3, 7, 7, 5, 16, 1 ], [ 5, 3, 7, 7, 7, 3, 3 ], [ 5, 3, 7, 7, 7, 9, 2 ], [ 5, 3, 7, 7, 7, 15, 1 ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
# FEATURE PossibleDivisibleDifferenceSetPairSizes(G)
DeclareGlobalFunction( "PossibleDivisibleDifferenceSetPairSizes" );

#############################################################################
##
#F  DifferenceSetsOfSizeK( <G>, <k> )
##
##  <#GAPDoc Label="DifferenceSetsOfSizeK">
##  <ManSection>
##  <Func Name="DifferenceSetsOfSizeK" Arg="G, k"/>
##
##  <Description>
##  Returns a list of all difference sets up to equivalence in the group
##  <A>G</A> that have size <A>k</A>.
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(16, 9);;
##  gap> DifferenceSetsOfSizeK(G, 1);
##  [ [ 1 ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
DeclareGlobalFunction( "DifferenceSetsOfSizeK" );
DeclareGlobalFunction( "DifferenceSetsOfSizeKOptimized" );
DeclareGlobalFunction( "DifferenceSetsOfSizeKWithMultiplier" );
DeclareGlobalFunction( "DifferenceSetsOfSizeKUseMultiplier" );

#############################################################################
##
#F  DifferenceSetPairsOfSizeK( <G>, <k1>, <k2>, <e>, <lambda> )
##
##  <#GAPDoc Label="DifferenceSetPairsOfSizeK">
##  <ManSection>
##  <Func Name="DifferenceSetPairsOfSizeK" Arg="G, k1, k2, e, lambda"/>
##
##  <Description>
##  Returns a list of all difference set pairs up to equivalence in the group
##  <A>G</A> that have size [<A>k1</A>,<A>k2</A>,<A>e</A>,<A>lambda</A>].
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(16, 9);;
##  gap> DifferenceSetPairsOfSizeK(G,1,1,1,0);
##  [ [ [ 1 ], [ 1 ] ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
# FEATURE DifferenceSetPairsOfSizeK(G, k1, k2, e, lambda)
DeclareGlobalFunction( "DifferenceSetPairsOfSizeK" );
DeclareGlobalFunction( "DifferenceSetPairsOfSizeKOptimized" );
DeclareGlobalFunction( "DifferenceSetPairsOfSizeKWithMultiplier" );

#############################################################################
##
#F  DivisibleDifferenceSetsOfSizeK(<G>, <w>, <v>, <l>, <lambda1>, <lambda2>)
##
##  <#GAPDoc Label="DivisibleDifferenceSetsOfSizeK">
##  <ManSection>
##  <Func Name="DivisibleDifferenceSetsOfSizeK" Arg="G, w, v, l, lambda1, lambda2"/>
##
##  <Description>
##  Returns a list of all divisible difference sets up to equivalence in the group
##  <A>G</A> that have size [<A>w</A>,<A>v</A>,<A>l</A>,<A>lambda1</A>,<A>lambda2</A>].
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(16, 9);;
##  gap> DivisibleDifferenceSetsOfSizeK(G,16,1,1,0,0);
##  [ [ 1 ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
# FEATURE DivisibleDifferenceSetsOfSizeK(G, w, v, l, lambda1, lambda2)
DeclareGlobalFunction( "DivisibleDifferenceSetsOfSizeK" );

#############################################################################
##
#F  DivisibleDifferenceSetPairsOfSizeK(<G>, <w>, <v>, <l1>, <l2>, <le>, <lambda1>, <lambda2>)
##
##  <#GAPDoc Label="DivisibleDifferenceSetPairsOfSizeK">
##  <ManSection>
##  <Func Name="DivisibleDifferenceSetPairsOfSizeK" Arg="G, w, v, l1, l2, le, lambda1, lambda2"/>
##
##  <Description>
##  Returns a list of all divisible difference set pairs up to equivalence in the group
##  <A>G</A> that have size [<A>w</A>,<A>v</A>,<A>l1</A>,<A>l2</A>,<A>le</A>,<A>lambda1</A>,<A>lambda2</A>].
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(16, 9);;
##  gap> DivisibleDifferenceSetPairsOfSizeK(G,16,1,1,1,1,0,0);
##  [ [ [ 5 ], [ 5 ] ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
# FEATURE DivisibleDifferenceSetPairsOfSizeK(G, w, v, l1, l2, le, lambda1, lambda2)
DeclareGlobalFunction( "DivisibleDifferenceSetPairsOfSizeK" );

#############################################################################
##
#F  DifferenceSets( <G> )
##
##  <#GAPDoc Label="DifferenceSets">
##  <ManSection>
##  <Func Name="DifferenceSets" Arg="G"/>
##
##  <Description>
##  Returns a list of all difference sets up to equivalence in the group
##  <A>G</A>. Only the smaller of each complementary pair of difference sets
##  is included, and one-element difference sets are ignored.
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(16, 9);;
##  gap> DifferenceSets(G);
##  [ [ 1, 2, 3, 4, 7, 10 ], [ 1, 2, 3, 4, 8, 9 ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
DeclareGlobalFunction( "DifferenceSets" );
DeclareGlobalFunction( "DifferenceSetsOptimized" );
DeclareGlobalFunction( "DifferenceSetsWithMultiplier" );
DeclareGlobalFunction( "DifferenceSetsUseMultiplier" );

#############################################################################
##
#F  DifferenceSetPairs( <G> )
##
##  <#GAPDoc Label="DifferenceSetPairs">
##  <ManSection>
##  <Func Name="DifferenceSetPairs" Arg="G"/>
##
##  <Description>
##  Returns a list of all difference set pairs up to equivalence in the group
##  <A>G</A>. Only the smaller of each complementary pair of difference sets
##  is included, and one-element difference sets are ignored.
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(16, 9);;
##  gap> DifferenceSetPairs(G);
##  [ [ [ 1, 11, 13, 16 ], [ 1, 3, 5, 10 ] ], [ [ 1, 8, 11, 14 ], [ 1, 3, 5, 10 ] ], [ [ 1, 8, 11, 13 ], [ 1, 5, 9, 15 ] ],
##  [ [ 1, 8, 10, 13 ], [ 1, 4, 5, 11 ] ], [ [ 1, 6, 8, 10 ], [ 1, 4, 5, 11 ] ], [ [ 1, 5, 6, 13 ], [ 1, 10, 11, 15 ] ],
##  [ [ 1, 4, 8, 13 ], [ 1, 5, 9, 15 ] ], [ [ 1, 4, 5, 11 ], [ 1, 8, 10, 13 ] ], [ [ 1, 2, 5, 8 ], [ 1, 10, 11, 15 ] ],
##  [ [ 1, 2, 8, 10, 11, 15 ], [ 1, 2, 8, 10, 11, 15 ] ], [ [ 1, 2, 8, 9, 10, 11 ], [ 1, 2, 8, 9, 10, 11 ] ],
##  [ [ 1, 8, 9, 10, 11, 13, 14 ], [ 1, 8, 9, 10, 11, 13, 14 ] ], [ [ 1, 8, 10, 11, 13, 14, 15, 16 ], [ 1, 5 ] ],
##  [ [ 1, 8, 9, 10, 11, 13, 14, 16 ], [ 1, 5 ] ], [ [ 1, 4, 5, 6, 11, 12, 13, 16 ], [ 1, 10 ] ],
##  [ [ 1, 2, 4, 5, 7, 8, 11, 14 ], [ 1, 10 ] ], [ [ 1, 2, 4, 5, 6, 8, 11, 13 ], [ 1, 15 ] ],
##  [ [ 1, 2, 3, 5, 6, 8, 10, 13 ], [ 1, 11 ] ], [ [ 1, 8, 10, 11, 13, 14, 15, 16 ], [ 1, 4, 5, 11 ] ],
##  [ [ 1, 8, 9, 10, 11, 13, 14, 16 ], [ 1, 4, 5, 11 ] ], [ [ 1, 5, 8, 10, 13, 14, 15, 16 ], [ 1, 4, 5, 11 ] ],
##  [ [ 1, 5, 8, 10, 12, 13, 14, 15 ], [ 1, 4, 5, 11 ] ], [ [ 1, 5, 6, 8, 10, 13, 14, 15 ], [ 1, 4, 5, 11 ] ],
##  [ [ 1, 4, 5, 8, 11, 13, 14, 16 ], [ 1, 3, 5, 10 ] ], [ [ 1, 4, 5, 6, 11, 12, 13, 16 ], [ 1, 3, 5, 10 ] ],
##  [ [ 1, 4, 5, 6, 8, 11, 13, 16 ], [ 1, 5, 9, 15 ] ], [ [ 1, 2, 5, 8, 10, 13, 15, 16 ], [ 1, 4, 5, 11 ] ],
##  [ [ 1, 2, 5, 8, 10, 12, 13, 15 ], [ 1, 4, 5, 11 ] ], [ [ 1, 2, 5, 8, 9, 10, 12, 13 ], [ 1, 4, 5, 11 ] ],
##  [ [ 1, 2, 4, 5, 8, 11, 13, 14 ], [ 1, 5, 9, 15 ] ], [ [ 1, 2, 4, 5, 7, 8, 11, 14 ], [ 1, 3, 5, 10 ] ],
##  [ [ 1, 2, 4, 5, 6, 8, 11, 13 ], [ 1, 5, 9, 15 ] ], [ [ 1, 2, 3, 5, 8, 10, 13, 16 ], [ 1, 4, 5, 11 ] ],
##  [ [ 1, 2, 3, 5, 8, 10, 12, 13 ], [ 1, 4, 5, 11 ] ], [ [ 1, 2, 3, 5, 6, 8, 10, 13 ], [ 1, 4, 5, 11 ] ],
##  [ [ 1, 8, 10, 11, 13, 14, 15, 16 ], [ 1, 3, 4, 5, 10, 11 ] ], [ [ 1, 8, 9, 10, 11, 13, 14, 16 ], [ 1, 3, 4, 5, 10, 11 ] ],
##  [ [ 1, 4, 5, 6, 11, 12, 13, 16 ], [ 1, 3, 5, 10, 11, 15 ] ], [ [ 1, 2, 4, 5, 7, 8, 11, 14 ], [ 1, 3, 5, 10, 11, 15 ] ],
##  [ [ 1, 2, 4, 5, 6, 8, 11, 13 ], [ 1, 5, 9, 10, 11, 15 ] ], [ [ 1, 2, 3, 5, 6, 8, 10, 13 ], [ 1, 4, 5, 10, 11, 15 ] ],
##  [ [ 1, 8, 10, 11, 13, 14, 15, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 8, 9, 10, 11, 13, 14, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 8, 10, 13, 14, 15, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 8, 10, 12, 13, 14, 15 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 8, 10, 11, 13, 14, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 8, 10, 11, 12, 13, 14 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 7, 8, 10, 11, 13, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 7, 8, 10, 11, 12, 13 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 6, 8, 10, 13, 14, 15 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 6, 8, 10, 11, 13, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 6, 8, 10, 11, 13, 14 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 6, 8, 10, 11, 12, 14 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 6, 8, 10, 11, 12, 13 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 5, 6, 7, 8, 10, 11, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ], [ [ 1, 5, 6, 7, 8, 10, 11, 13 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ]
##      ], [ [ 1, 4, 5, 8, 11, 13, 14, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 4, 5, 8, 10, 11, 14, 15 ], [ 1, 2, 3, 5, 6, 8, 10, 13 ] ],
##  [ [ 1, 4, 5, 6, 11, 12, 13, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 4, 5, 6, 8, 11, 13, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ], [ [ 1, 4, 5, 6, 8, 11, 13, 14 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ]
##      ], [ [ 1, 2, 5, 8, 10, 13, 15, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 5, 8, 10, 12, 13, 15 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 5, 8, 10, 11, 14, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 5, 8, 10, 11, 13, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 5, 8, 10, 11, 13, 14 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 5, 8, 10, 11, 12, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 5, 8, 10, 11, 12, 14 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 5, 8, 10, 11, 12, 13 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 5, 8, 9, 10, 12, 13 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ], [ [ 1, 2, 5, 7, 8, 10, 11, 13 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ]
##      ], [ [ 1, 2, 5, 6, 8, 10, 11, 13 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 4, 5, 8, 11, 13, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ], [ [ 1, 2, 4, 5, 8, 11, 13, 14 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ]
##      ], [ [ 1, 2, 4, 5, 7, 8, 11, 14 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 4, 5, 6, 8, 11, 13 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ], [ [ 1, 2, 3, 5, 8, 10, 13, 16 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ]
##      , [ [ 1, 2, 3, 5, 8, 10, 12, 13 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 3, 5, 6, 8, 10, 13 ], [ 1, 3, 4, 5, 9, 10, 11, 15 ] ],
##  [ [ 1, 2, 3, 4, 5, 8, 10, 11 ], [ 1, 8, 10, 11, 13, 14, 15, 16 ] ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
# FEATURE DifferenceSetPairs(G)
DeclareGlobalFunction( "DifferenceSetPairs" );
DeclareGlobalFunction( "DifferenceSetPairsOptimized" );
DeclareGlobalFunction( "DifferenceSetPairsWithMultiplier" );
DeclareGlobalFunction( "DifferenceSetPairsUseMultiplierOfAbelianGroupOfSizeK" );
DeclareGlobalFunction( "DifferenceSetPairsUseMultiplierOfAbelianGroup" );

#############################################################################
##
#F  DivisibleDifferenceSets( <G> )
##
##  <#GAPDoc Label="DivisibleDifferenceSets">
##  <ManSection>
##  <Func Name="DivisibleDifferenceSets" Arg="G"/>
##
##  <Description>
##  Returns a list of all divisible difference sets up to equivalence in the group
##  <A>G</A>. Only the smaller of each complementary pair of difference sets
##  is included, and one-element difference sets are ignored.
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(16, 9);;
##  gap> DivisibleDifferenceSets(G);
##  [  ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
# FEATURE DivisibleDifferenceSets(G)
DeclareGlobalFunction( "DivisibleDifferenceSets" );

#############################################################################
##
#F  DivisibleDifferenceSetPairs( <G> )
##
##  <#GAPDoc Label="DivisibleDifferenceSetPairs">
##  <ManSection>
##  <Func Name="DivisibleDifferenceSetPairs" Arg="G"/>
##
##  <Description>
##  Returns a list of all divisible difference set pairs up to equivalence in the group
##  <A>G</A>. Only the smaller of each complementary pair of difference sets
##  is included, and one-element difference sets are ignored.
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(16, 9);;
##  gap> DivisibleDifferenceSetPairs(G);
##  [  ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
# FEATURE DivisibleDifferenceSetPairs(G)
DeclareGlobalFunction( "DivisibleDifferenceSetPairs" );

#############################################################################
##
#F  DifferenceSumsOfSizeK( <G>, <N>, <k> )
##
##  <#GAPDoc Label="DifferenceSumsOfSizeK">
##  <ManSection>
##  <Func Name="DifferenceSumsOfSizeK" Arg="G, N, k"/>
##
##  <Description>
##  Returns a list of all difference sums up to equivalence in the group
##  <A>G</A> mod its normal subgroup <A>N</A> that have size <A>k</A>.
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(16, 8);;
##  gap> N := Subgroup(G, [G.3, G.4]);;
##  gap> DifferenceSumsOfSizeK(G, N, 1);
##  [ [ 1, 0, 0, 0 ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
DeclareGlobalFunction( "DifferenceSumsOfSizeK" );

#############################################################################
##
#F  DifferenceSums( <G>, <N> )
##
##  <#GAPDoc Label="DifferenceSums">
##  <ManSection>
##  <Func Name="DifferenceSums" Arg="G, N"/>
##
##  <Description>
##  Returns a list of all difference sums up to equivalence in the group
##  <A>G</A> mod its normal subgroup <A>N</A>. Only the smaller of each
##  complementary pair of difference sums is included, and difference sums
##  of size 1 are ignored.
##
##  <Example><![CDATA[
##  gap> G := SmallGroup(16, 8);;
##  gap> N := Subgroup(G, [G.3, G.4]);;
##  gap> DifferenceSums(G, N);
##  [ [ 3, 1, 1, 1 ], [ 2, 2, 2, 0 ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
DeclareGlobalFunction( "DifferenceSums" );

#############################################################################
##
#E

